package com.coupons.business.merchant.service;

import java.util.List;

import com.coupons.business.common.exception.BaseCouponsAppException;
import com.coupons.business.common.vo.Merchant;
import com.coupons.business.merchant.controller.IMerchantManager;
import com.coupons.business.merchant.dao.IMerchantDAO;

public class MerchantManagerService implements IMerchantManager 
{
	IMerchantDAO merchantDAO;  
	public IMerchantDAO getMerchantDAO() 
	{
		
		return merchantDAO;
	}

	public void setMerchantDAO(IMerchantDAO merchantDAO) 
	{
		this.merchantDAO = merchantDAO;
	}

	@Override
	public void createMerchant(Merchant objaMerchant)
			throws BaseCouponsAppException 
	{
		merchantDAO.createMerchant(objaMerchant);
	}

	@Override
	public void updateMerchant(Merchant objaMerchant)
			throws BaseCouponsAppException 
	{
		merchantDAO.updateMerchant(objaMerchant);
	}

	@Override
	public Merchant getMerchant(int MerchantId) throws BaseCouponsAppException 
	{		
		return merchantDAO.getMerchant(MerchantId);		 
	}

	@Override
	public List<Merchant> getAllMerchants() throws BaseCouponsAppException 
	{
			return merchantDAO.getAllMerchants();
	}
	
	public Merchant getMerchant(String straMerchantName) throws BaseCouponsAppException 
	{		
		return merchantDAO.getMerchant(straMerchantName);		 
	}
}
